package com.jinhongone.pattern.creater.singleton.demo9;

import java.io.IOException;
import java.io.InputStream;

public class RuntimeDemo {

    public static void main(String[] args) throws IOException {
//      jvm关于单例模式的运用 Runtime类
        Runtime runtime = Runtime.getRuntime();
        Process ipconfig = runtime.exec("ipconfig -a");
        InputStream inputStream = ipconfig.getInputStream();
        byte[] arr = new byte[1024 * 1024];
        int read = inputStream.read(arr);
        System.out.println(new String(arr, 0, read,"gbk"));
    }
}
